﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="getdirectory.aspx.cs" Inherits="Golf.getdirectory" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<script type="text/javascript">
    function upfunc() {
        if (document.getElementById("txtPath").value == null || document.getElementById("txtPath").value == "") {
            alert("请输入上传路径！");
            return false;
        }
        if (document.getElementById("file").value == null || document.getElementById("file").value == "") {
            alert("请选择上传文件！");
            return false;
        }
        return true;
    }
    </script>
<body>
    <form id="form1" runat="server">
       <asp:Panel runat="server" ID="pan1">
        <div>
            请选择上传路径：
            <asp:DropDownList ID="DDLPath" runat="server" Width="806px" Height="22px" AutoPostBack="true" 
                onselectedindexchanged="DDLPath_SelectedIndexChanged"></asp:DropDownList>
            <br />
            <br />
            请输入上传路径：
            <asp:TextBox ID="txtPath" runat="server"  Width="800px"></asp:TextBox>
            <br />
            <br />
            请选择上传文件：
            <asp:FileUpload ID="file" runat="server" Width="700px" />
            <asp:Button ID="BtnUpload" runat="server" Text="上传" Width="100px" OnClientClick=" return upfunc();"  OnClick="BtnUpload_Click" />
            <br />
            <br />
        </div>
        <div>
            <asp:GridView ID="filelist" runat="server" Width="940px" HeaderStyle-HorizontalAlign="Center"
                AutoGenerateColumns="False" EnableModelValidation="True" BackColor="White" 
                BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" 
                GridLines="Horizontal" DataKeyNames="name" 
                onrowdatabound="filelist_RowDataBound" 
                onrowdeleting="filelist_RowDeleting" onsorting="filelist_Sorting" 
                AllowSorting="True">
                <Columns>
                    <asp:BoundField DataField="name" HeaderText="文件名" HeaderStyle-HorizontalAlign="Center" SortExpression="name" />
                    <asp:BoundField DataField="type" HeaderText="文件类型" HeaderStyle-HorizontalAlign="Center" SortExpression="type" />
                    <asp:BoundField DataField="createTime" HeaderText="创建时间" HeaderStyle-HorizontalAlign="Center" SortExpression="createTime" />
                    <asp:BoundField DataField="size" HeaderText="文件大小" HeaderStyle-HorizontalAlign="Center" SortExpression="size" />
                    <asp:BoundField DataField="updateTime" HeaderText="上次更改时间" HeaderStyle-HorizontalAlign="Center" SortExpression="updateTime" />
                    <asp:TemplateField HeaderText="操作" HeaderStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlDownload" runat="server" Text="下载"></asp:HyperLink>
                            <asp:Button ID="btndownload" runat="server" Text="删除" CommandArgument='<%# Eval("name") %>' OnClick="btndownload_Click" />
<%--                            <asp:Button ID="hlDelete" runat="server" Text="删除" CommandName="delete" CommandArgument='<%# Eval("name") %>' OnClick="hlDelete_Click" ></asp:Button>
--%>                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="White" ForeColor="#333333" />
                <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="White" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
            </asp:GridView>
        </div>
        </asp:Panel>
    </form>
    
</body>
</html>
